-
Notifications
You must be signed in to change notification settings - Fork 16
feat: add total supply and annual supply change to overview #460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This enhances the overview by showing total supply alongside the yearly supply change, giving clearer context for the inflation metric.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR enhances the protocol overview by adding two new metrics: the current total supply of LPT tokens and the annual supply change rate (1-year inflation/deflation). The implementation replaces the unused totalTokenSupply API endpoint with a more comprehensive supply-change endpoint that calculates supply metrics over a 365-day period.
Key changes:
- Introduces a new
/supply-changeAPI endpoint that queries historical supply data from the subgraph - Adds UI components to display total supply and annual supply change percentage in the RoundStatus component
- Removes the old
totalTokenSupplyAPI endpoint that was not being used
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pages/api/totalTokenSupply.tsx | Removes unused API endpoint that only returned total supply |
| pages/api/supply-change.tsx | Adds new API endpoint to calculate supply metrics over 365 days, returning start/end dates, supplies, and the supply change percentage |
| lib/api/types/get-supply-change.ts | Defines TypeScript type for the supply change API response |
| hooks/useSwr.tsx | Adds useSupplyChangeData hook following existing SWR patterns |
| components/RoundStatus/index.tsx | Integrates new metrics into the UI with tooltips, removes padding adjustment, and adds display logic for both total supply and annual supply change |
| pages/treasury/create-proposal.tsx | Minor indentation fix for Text component (unrelated formatting improvement) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Ensure the new supply-change route correctly handles errors. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Ensure the supplyChange check properly handles both null and undefined to avoid displaying misleading formatted values when data is unavailable. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This enhances the overview by showing total supply alongside the yearly supply change, giving clearer context for the inflation metric.
@ECWireless, @mehrdadmms please check with governance advisory board members @b3nnnp and @dob on whether and how we want to showcase this.